package net.wanho.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.RequiredArgsConstructor;
import net.wanho.mapper.StudentMapper;
import net.wanho.po.Student;
import net.wanho.service.StudentService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Author：汤小洋
 * Date：2024-01-08 15:15
 * Description：<描述>
 */
@Service
@Transactional(rollbackFor = Exception.class)
@RequiredArgsConstructor
public class StudentServiceImpl implements StudentService {

    private final StudentMapper studentMapper;

    @Override
    public PageInfo<Student> findPage(int pageNum, int pageSize, Student stu) {
        PageHelper.startPage(pageNum,pageSize);
        return new PageInfo<>(studentMapper.select(stu));
    }

}
